<template>
  <div class="exam_items" @click="toDetail">
    <span>{{test.score}}</span>
    <span>{{test.tag_Name}}</span>

  </div>
</template>

<script>
  import { mapState } from 'vuex'
  import HistoryDetailApi from '@/api/historydetail'

  export default {
    name: 'History_list',
    props: [
      'test', 'index'
    ],
    mounted () {
      // console.log(this.test)
    },
    computed: {
      ...mapState(['examList', 'openId'])
    },
    methods: {
      toDetail () {
        // console.log(this.test)
        HistoryDetailApi.getHistoryDetail(this.test)
          .then((resp) => {
            // this.hisExam = resp
            // console.log(this.hisExam)
            this.$store.dispatch('getExam', resp)
            wx.navigateTo({url: '../historyDetail/main'})
          })
          .catch((error) => {
            console.log(error)
          })
      }
    }
  }
</script>

<style scoped>
  .exam_items{
    display: flex;
    padding: 30rpx;
    background-color: #2fad62;
    border-radius: 20rpx;
    height: 20px;
    margin: 10rpx
  }

  .exam_items span{
    margin-left: 30rpx;
    font-size: 30rpx;
    color: #fffeff;
    text-align: center;
    line-height: 20px;
  }
</style>
